from flask import Flask, request, jsonify
from ConsultAPI.ProposalAPI import Proposal
from ConsultAPI.conf import html_path, html_ex_path, xml_file
from ConsultAPI.manage import Manage
import traceback
import logging
import logging.config

# # 导入日志配置文件
# logging.config.fileConfig("dictionary/logging.conf")
# # 创建日志对象
# logger = logging.getLogger()
# loggerInfo = logging.getLogger("TimeInfoLogger")
# Consolelogger = logging.getLogger("ConsoleLogger")
# app = Flask(__name__)
#
#
# @app.route("/consult", methods=["POST"])
# def consult():
#     res = request.get_json()
#     # 获取uuid
#     uuid = res['uuid']
#     logger.debug("%s" % uuid)
#     proposal = Proposal(uuid=uuid)
#     # 生成点击流程path路径
#     dispute_type_id, user_path = proposal.process_content()
#     try:
#         # 返回最终动态文件内容
#         manage = Manage(xml_file, user_path, 3, html_path, uuid)
#         res = manage.return_report_string()
#         print(res)
#     except:
#         print(traceback.format_exc())
#         res = ''
#     return res


if __name__ == '__main__':
    # app.run(host="0.0.0.0", port=5002, debug=True)

    uuid = '2a7c71986ee1419eaaa034d86132a14a'
    proposal = Proposal(uuid=uuid, )
    # 生成点击流程path路径
    dispute_type_id, user_path = proposal.process_content()
    try:
        # 返回最终动态文件内容
        manage = Manage(xml_file, html_path, uuid)
        res = manage.return_report_string()
        print(res)
    except:
        print('出错了')